﻿Public Class Form2
    Private loaded As Boolean = False
    Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Form2_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing
        e.Cancel = True
        Hide()
    End Sub

    Private Sub Form2_VisibleChanged(sender As Object, e As EventArgs) Handles Me.VisibleChanged
        If Visible Then
            OpacityTrackBar.Value = Form1.Opacity * 10
            TextAutoColorCheckBox.Checked = Form1.Config.GetAtt("字色渐变", True)
            UTTextBox.Text = Form1.Config.GetAtt("UT", "")
            SHCheckBox.Checked = Form1.Config.GetAtt("显示上证", False)
            SZCheckBox.Checked = Form1.Config.GetAtt("显示深证", False)
            CYCheckBox.Checked = Form1.Config.GetAtt("显示创业板", False)
            loaded = True
        Else
            loaded = False
        End If
    End Sub

    Private Sub OpacityTrackBar_Scroll(sender As Object, e As EventArgs) Handles OpacityTrackBar.Scroll
        If Not loaded Then
            Return
        End If
        Form1.Opacity = OpacityTrackBar.Value * 0.1
        Form1.Config.SetAtt("窗体透明度"， Form1.Opacity, HarryNode.NodeTypeEnum.isSingle)
    End Sub

    Private Sub TextAutoColorCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles TextAutoColorCheckBox.CheckedChanged
        If Not loaded Then
            Return
        End If
        Form1.Config.SetAtt("字色渐变"， TextAutoColorCheckBox.Checked, HarryNode.NodeTypeEnum.isBool)
    End Sub

    Private Sub UTTextBox_TextChanged(sender As Object, e As EventArgs) Handles UTTextBox.TextChanged
        If Not loaded Then
            Return
        End If
        Form1.Config.SetAtt("UT"， UTTextBox.Text, HarryNode.NodeTypeEnum.isString)
    End Sub

    Private Sub SHCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles SHCheckBox.CheckedChanged
        If Not loaded Then
            Return
        End If
        Form1.Config.SetAtt("显示上证"， SHCheckBox.Checked, HarryNode.NodeTypeEnum.isBool)
    End Sub

    Private Sub SZCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles SZCheckBox.CheckedChanged
        If Not loaded Then
            Return
        End If
        Form1.Config.SetAtt("显示深证"， SZCheckBox.Checked, HarryNode.NodeTypeEnum.isBool)
    End Sub

    Private Sub CYCheckBox_CheckedChanged(sender As Object, e As EventArgs) Handles CYCheckBox.CheckedChanged
        If Not loaded Then
            Return
        End If
        Form1.Config.SetAtt("显示创业板"， CYCheckBox.Checked, HarryNode.NodeTypeEnum.isBool)
    End Sub
End Class